package com.tencent.hummingbird.portal.advice;

import com.tencent.hummingbird.portal.r.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.rmi.ServerException;

@RestControllerAdvice
@Slf4j
public class ExceptionControllerAdvice {
    @ExceptionHandler
    public R handlerServiceException(ServerException e){
        e.printStackTrace();
        log.error("发生业务异常",e);
        return R.failed(e);
    }
    @ExceptionHandler
    public R handlerException(Exception e){
        e.printStackTrace();
        log.error("发生未知异常",e);
        return R.failed(e);
    }


}
